Skip to content

Fix collection issue in Pytest 9 with overridden fixtures#376

Merged
smarie merged 6 commits intosmarie:mainfrom
jammer87:pytest-9
Mar 2, 2026
Merged

Fix collection issue in Pytest 9 with overridden fixtures#376
smarie merged 6 commits intosmarie:mainfrom
jammer87:pytest-9

Conversation

@jammer87
Copy link
Contributor

@jammer87 jammer87 commented Jan 8, 2026

Addresses #374 which was introduced by the pytest fixes for pytest-dev/pytest#13773

@smarie feel free to close/take over as part of larger Pytest 9 support.

If you want a single PR with #376, #377, #378, #379, #380 with merge conflicts fixed, you can create a new one from https://github.com/jammer87/python-pytest-cases/tree/all-my-merges


# add all dependencies in the to do list
dependencies = _fixdef.argnames
# add all dependencies, accounting for overrides
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to make a test case that would affect the equivalent on line 322 so I didn't make any changes there

@smarie
Copy link
Owner

smarie commented Jan 21, 2026

This is awesome @jammer87 ! I'll take some time to review all of these and come back with either comments or merge

@smarie
Copy link
Owner

smarie commented Mar 2, 2026

Hello @jammer87 , thanks for your patience ! I was able to

  • reproduce the bug locally,
  • inject your fix (I rather moved the tests to the meta tester engine, as you'll see)
  • see that it works :).

However there are more complex situations that are not handled in this fix and that were further handled by pytest-dev/pytest#13789. I am looking at them now to make sure the fix covers all

smarie pushed a commit that referenced this pull request Mar 2, 2026
…ytest. It has not been tested against pytest<9
@smarie
Copy link
Owner

smarie commented Mar 2, 2026

Since I found an issue in pytest while updating your PR to handle all situations, I propose that we rather merge it as is. I pushed a changelog and a fix for the CI to be able to run again.

@smarie smarie merged commit 2ffa1e0 into smarie:main Mar 2, 2026
28 checks passed
@smarie
Copy link
Owner

smarie commented Mar 2, 2026

All set, thanks @jammer87 for this difficult fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants